<?php
if ($this->msg == TRUE) {
    echo "<input type='hidden' value='{$this->entity}' id='alunoControleRedirect'>";
    echo '<script src="/js/sisesporte-admin/aluno/mensagem.js"></script>';
}

$tpPessoa = $_SESSION["SisesporteAdmin"]->storage["user"]->inTipoPessoa;
$sqPessoa = $_SESSION["SisesporteAdmin"]->storage["user"]->sqPessoa;

if ($tpPessoa != "A") :
    ?>
    <?php
    $rota_permitida = $this->url('sisesporte-admin-interna', array('controller' => 'aluno', 'action' => 'edit', 'id' => $sqPessoa));
    if ($tpPessoa == "A") {

        if ($_SERVER['REQUEST_URI'] != $rota_permitida) {
            header('Location: ' . $this->url('sisesporte-admin-logout'));
            exit;
        }
    }
    ?>
    <!-- Botões -->
    <div class="row-fluid">
        <div class="span2 action-btn round-all">
            <a href="<?php echo $this->url('sisesporte-admin', array('controller' => 'aluno')) ?>" title="Consultar">
                <div><i class="icon-th-list"></i></div>
                <div><strong>Consultar</strong></div>
            </a>
        </div>
    </div>
    <!-- Fim Botões -->
<?php endif; ?>
<?php
$form = $this->form;
$form->setAttribute('action', $this->url('sisesporte-admin-interna', array('controller' => 'aluno', 'action' => 'edit', 'id' => $this->entity)));
$form->prepare();
echo $this->form()->openTag($form);
?>
<!-- Dados Pessoais -->
<div class="row-fluid">
    <div class="span12 column" id="col0"> 
        <div class="box">
            <h4 class="box-header round-top">Dados Pessoais
                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     
            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span7">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noPessoa')) ?>
                                </div>
                            </div>
                            <div class="span5">
                                <div class="controls controls-rows">
                                    <img style="margin: 70px 235px 0; position: absolute;" src='<?php echo "/" . $this->form->get("txCaminhoFoto")->getValue() ?>' width="114" height="152" />
                                    <?php echo $this->formRow($form->get('noImagem')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="span3">
                                <div class="input-append date" id="dpDtNascimento" data-date="<?php echo date('d/m/Y') ?>" data-date-format="dd/mm/yyyy">
                                    <?php echo $this->formRow($form->get('dtNascimento')) ?>
                                    <span class="add-on"><i class="icon-calendar"></i></span>
                                </div>
                            </div>
                            <div class="span2">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('nuIdade')) ?>
                                </div>
                            </div>
                            <div class="span3" id="divNuCPF">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('nuCpf')) ?>
                                </div>
                            </div>
                            <div class="span3" id="divNuCN">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('nuCertidaoNascimento')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('nuIdentidade')) ?>
                                </div>
                            </div>
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqOrgaoExpIdentidade')) ?>
                                </div>
                            </div> 
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqUfOrgExpedidor')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('inSexo')) ?>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqEstadoCivil')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqUfDadosPessoais')) ?>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqCidadeDadosPessoais')) ?>
                                    <?php echo $this->formRow($form->get('sqCidadeDadosPessoaisH')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noMae')) ?>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noTelefoneMae')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noPai')) ?>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noTelefonePai')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Fim Dados Pessoais -->
<!-- Dados do Contato -->
<div class="row-fluid">
    <div class="span12 column">
        <div class="box">
            <h4 class="box-header round-top">Dados de Contato
                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     
            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="controls controls-rows input-append">
                                <?php echo $this->formRow($form->get('nuCep')) ?>
                                <button type="button" id="btnCep" class="btn btn-primary" >
                                    <i class="icon-search icon-white"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noEndereco')) ?>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noComplemento')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noBairro')) ?>
                                </div>
                            </div>
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqUfDadosContato')) ?>
                                </div>
                            </div>
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqCidadeDadosContato')) ?>
                                    <?php echo $this->formRow($form->get('sqCidadeDadosContatoH')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noTelefoneFixo')) ?>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noTelefoneMovel')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('noEmail')) ?>
                            </div>
                        </div>
                    </div>

                    <div class="row-fluid">
                        <div class="alert alert-info span10">
                            <span>O endereço de e-mail deve ser válido, pois é através dele que receberá o número de sua inscrição e senha.</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Fim Dados do Contato -->
<!-- Dados do Responsavel -->
<div class="row-fluid" id="divResponsavel">
    <div class="span12 column" id="col0">
        <div class="box" id="box-0">
            <h4 class="box-header round-top">Dados do Responsavel
                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     
            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('sqParentescoR')) ?>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noResponsavelR')) ?>
                                </div>
                            </div>
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noTelefoneR')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>                
            </div>
        </div>
    </div>
</div>
<!-- Fim Dados do Responsavel -->
<!-- Caso de emergencia -->
<div class="row-fluid">
    <div class="span12 column" id="col0">
        <div class="box" id="box-0">
            <h4 class="box-header round-top">Em caso de emergência
                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     
            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('sqParentesco')) ?>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noResponsavel')) ?>
                                </div>
                            </div>
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noTelefone')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>                
            </div>
        </div>
    </div>
</div>
<!-- Fim Caso de emergencia -->
<!-- Dados de Escolaridade/Profissão -->
<div class="row-fluid">
    <div class="span12 column" id="col0">
        <div class="box" id="box-0">
            <h4 class="box-header round-top">Dados de Escolaridade/Profissão

                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     

            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('inEstuda')) ?>
                            </div>
                        </div>
                        <!--                    </div>
                                            <div class="row-fluid">-->
                        <div class="span6">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('sqGrauEscolaridade')) ?>
                            </div>
                        </div>
                    </div>
                    <div id="divInEstuda">
                        <div class="row-fluid">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('noInstituicaoEnsino')) ?>
                                </div>
                            </div>
                            <!--                    </div>
                                                <div class="row-fluid">-->
                            <div class="span6">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('inTipoEscola')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid" id="divInTrabalha">
                        <div class="span3">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('inTrabalha')) ?>
                            </div>
                        </div>
                        <!--                    </div>
                                            <div class="row-fluid">-->
                        <div id="divInTrabalhaOp">
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqProfissao')) ?>
                                </div>
                            </div>
                            <!--                    </div>
                                                <div class="row-fluid">-->
                            <div class="span3">
                                <div class="controls controls-rows">
                                    <?php echo $this->formRow($form->get('sqRendaFamiliar')) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Fim Dados de Escolaridade/Profissão -->
<!-- Saúde -->
<div class="row-fluid">
    <div class="span12 column" id="col0">
        <div class="box" id="box-0">
            <h4 class="box-header round-top">Saúde

                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     

            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('inPlanoSaude')) ?>
                            </div>
                        </div>
                        <div class="span4">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('sqPlanoSaude')) ?>
                            </div>
                        </div>
                        <div class="span4">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('sqTipoSanguineo')) ?>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span7">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('inPortadorNecessidade')) ?>

                            </div>
                            <div class="alert alert-info span7">
                                <span>* Entregar laudo médico para recebimento da carteirinha.</span>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('inRemedioControlado')) ?>
                            </div>
                        </div>
                        <div class="span4">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('deRemedioControlado')) ?>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('inPossuiAlergia')) ?>
                            </div>
                        </div>
                        <div class="span4">
                            <div class="controls controls-rows">
                                <?php echo $this->formRow($form->get('deAlergia')) ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Fim Saude -->
<!-- Declaracao -->
<div class="row-fluid">
    <div class="span12 column" id="col0">
        <div class="box" id="box-0">
            <h4 class="box-header round-top">Declaração
                <a class="box-btn" title="toggle"><i class="icon-minus"></i></a>     
            </h4>
            <div class="box-container-toggle">
                <div class="box-content">
                    <div class="row-fluid">
                        <div class="span10">
                            <p>Ao fazer minha inscrição, eu, abaixo assinado, pessoalmente ou por intermédio de meus representantes assumo
                                total responsabilidade por qualquer <br/>dano decorrente da minha participação da modalidade escolhida isentendo
                                a Secretaria de Esposter por eventuais perdas e danos que possuam<br/> advir.</p>
                            <p>Declaro que estou em boa forma física, atestada por médico e que tenho condições suficientes para participar
                                das atividade espostivas que escolhi.</p>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="span5">
                                <div class="controls controls-rows">
                                    <label class="control-label">Brasília, __/__/____</label>
                                </div>
                            </div>
                            <div class="span5">
                                <div class="controls controls-rows">
                                    <label class="control-label">_________________________________<br/>
                                        &nbsp;&nbsp;&nbsp; Assinatura do Aluno Responsável</label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Fim Declaracao -->
<!-- Botão -->
<div class="row-fluid">
    <div class="span12 form-actions pull-right btn-toolbar">
        <?php if ($tpPessoa == "A") { ?>
            <a class="btn btn-primary" href="<?php echo $this->url('sisesporte-admin-interna', array('controller' => 'aluno', 'action' => 'view', 'id' => $sqPessoa));
            ?>">
                <i class="icon-arrow-left icon-white center"></i>
                Voltar
            </a>
        <?php } else { ?>
            <a class="btn btn-primary" href="<?php echo $this->url('sisesporte-admin-interna', array('controller' => 'aluno'));
            ?>">
                <i class="icon-arrow-left icon-white center"></i>
                Voltar
            </a>
        <?php } ?>

        <?php echo $this->formRow($form->get('submit')) ?>

    </div>
</div>
<!-- Fim Botão -->
<?php
echo $this->form()->closeTag();
?>
<script src="/js/sisesporte-admin/aluno/edit.js"></script>
<script src="/js/sisesporte-admin/aluno/validate.js"></script>

